from calm.evaluator import Evaluator
from system.vec2 import Vec2

class DistEvaluator(Evaluator):
    def __init__(self, server, vars):
        self.point = (0,0)
        self.factor = 1
        
        Evaluator.__init__(self, server, vars)
        
    def endEvaluate(self, agent):
        return (Vec2(self.point) - Vec2(agent.getVar("pos"))).length() * self.factor
